// utils.js
export function formatPrice(price) {
    return `¥${price.toFixed(2)}`;
}

export async function checkLoginStatus() {
    try {
        const response = await auth.getCurrentUser();
        if (response.success) {
            return response.data;
        }
        return null;
    } catch (error) {
        return null;
    }
}

export function showMessage(type, message) {
    const messageDiv = document.createElement('div');
    messageDiv.className = `message ${type}`;
    messageDiv.textContent = message;
    document.body.appendChild(messageDiv);

    setTimeout(() => {
        messageDiv.remove();
    }, 3000);
}